﻿using System.Configuration;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Simple.Services;
using Simple.Services.System.QHSEViolationCategory.Models;

namespace Simple.WebApi.Controllers.System;

/// <summary>
/// 作业专业管理
/// </summary>
[Route("QHSEKeyWorkSpecialty/[action]")]
[ApiController]
public class QHSEKeyWorkSpecialtyController : ControllerBase
{
    private readonly QHSEKeyWorkSpecialtyService _keyWorkSpecialtyService;

    public QHSEKeyWorkSpecialtyController(QHSEKeyWorkSpecialtyService keyWorkSpecialtyService)
    {
        _keyWorkSpecialtyService = keyWorkSpecialtyService;
    }

    /// <summary>
    /// 作业专业列表
    /// </summary>
    /// <returns></returns>
    [HttpGet]
    [Authorize]
    [CustomAuthorize("hdv_qhse_data")]
    public async Task<AppResult> List()
    {
        List<QHSEKeyWorkSpecialtyModel> data = await _keyWorkSpecialtyService.GetAsync();
        return AppResult.Status200OK(data: data);
    }
    [HttpGet]
    [ValidateTimestampAndSignature]
    public async Task<AppResult> List1()
    {
        List<QHSEKeyWorkSpecialtyModel> data = await _keyWorkSpecialtyService.GetAsync();
        return AppResult.Status200OK(data: data);
    }



}

